<!DOCTYPE HTML>
<html lang="en-US" >
    
    <head>
        
        <meta charset="UTF-8">
        <title>新浪微博笔记 | 新浪微博开发笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="作为中国移动互联网的代表性产品之一，新浪微博涵盖了大量的移动互联网元素，通过对新浪微博的研究及模仿可以：">
        <meta name="generator" content="GitBook 1.0.3">
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    
    
    
    <link rel="next" href="./oschina.html" />
    
    

        
    </head>
    <body>
        
        
<link rel="stylesheet" href="gitbook/style.css">


        
    <div class="book"  data-level="0" data-basepath="." data-revision="1441588137619">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <ul class="summary">
        
    	
    	
    	

        

        
    
        
        <li class="chapter active" data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                        <i class="fa fa-check"></i>
                        
                         新浪微博笔记
                    </a>
                
            
            
            <ul class="articles">
                
    
        
        <li class="chapter " data-level="0.1" data-path="oschina.html">
            
                
                    <a href="./oschina.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.1.</b>
                        
                         项目部署
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.2" data-path="imagesassets.html">
            
                
                    <a href="./imagesassets.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.2.</b>
                        
                         图片素材
                    </a>
                
            
            
            <ul class="articles">
                
    
        
        <li class="chapter " data-level="0.2.1" data-path="imagesassets-01-icon_default.html">
            
                
                    <a href="./imagesassets-01-icon_default.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.2.1.</b>
                        
                         图标&amp;启动图片
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        
        <li class="chapter " data-level="0.3" data-path="createproject.html">
            
                
                    <a href="./createproject.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.</b>
                        
                         项目搭建
                    </a>
                
            
            
            <ul class="articles">
                
    
        
        <li class="chapter " data-level="0.3.1" data-path="createproject-01-createfiles.html">
            
                
                    <a href="./createproject-01-createfiles.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.1.</b>
                        
                         创建文件
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.3.2" data-path="createproject-02-addchildcontrollers.html">
            
                
                    <a href="./createproject-02-addchildcontrollers.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.2.</b>
                        
                         添加子控制器
                    </a>
                
            
            
            <ul class="articles">
                
    
        
        <li class="chapter " data-level="0.3.2.1" data-path="throw_catch.html">
            
                
                    <a href="./throw_catch.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.2.1.</b>
                        
                         throw catch
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.3.2.2" data-path="variablestype.html">
            
                
                    <a href="./variablestype.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.2.2.</b>
                        
                         变量类型推导
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        
        <li class="chapter " data-level="0.3.3" data-path="createproject-03-costommaintabbar.html">
            
                
                    <a href="./createproject-03-costommaintabbar.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.3.</b>
                        
                         添加加号按钮
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.3.4" data-path="createproject-04-summary.html">
            
                
                    <a href="./createproject-04-summary.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.4.</b>
                        
                         阶段性小结
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        
        <li class="chapter " data-level="0.4" data-path="visitor.html">
            
                
                    <a href="./visitor.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.</b>
                        
                         未登录页面处理
                    </a>
                
            
            
            <ul class="articles">
                
    
        
        <li class="chapter " data-level="0.4.1" data-path="visitor-01-basetableviewcontroller.html">
            
                
                    <a href="./visitor-01-basetableviewcontroller.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.1.</b>
                        
                         表格视图控制器基类
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.4.2" data-path="visitor-02-userloginview.html">
            
                
                    <a href="./visitor-02-userloginview.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.2.</b>
                        
                         用户登录视图
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.4.3" data-path="visitor-03-loginlogic.html">
            
                
                    <a href="./visitor-03-loginlogic.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.3.</b>
                        
                         设置未登录信息
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.4.4" data-path="visitor-04-homeanimation.html">
            
                
                    <a href="./visitor-04-homeanimation.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.4.</b>
                        
                         首页动画
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.4.5" data-path="visitor-05-logindelegate.html">
            
                
                    <a href="./visitor-05-logindelegate.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.5.</b>
                        
                         登录&amp;注册代理回调
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.4.6" data-path="visitor-06-setupappearance.html">
            
                
                    <a href="./visitor-06-setupappearance.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.6.</b>
                        
                         设置全局外观
                    </a>
                
            
            
        </li>
    
        
        <li class="chapter " data-level="0.4.7" data-path="visitor-07-summary.html">
            
                
                    <a href="./visitor-07-summary.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.7.</b>
                        
                         阶段性小结
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        
        <li class="chapter " data-level="0.5" data-path="code_review.html">
            
                
                    <a href="./code_review.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.</b>
                        
                         代码评审(Code Review)
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Published using GitBook</a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Toggle search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Toggle font settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Toggle share dropdown"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">Twitter</button>
                <button type="button" data-sharing="google-plus" class="button">Google</button>
                <button type="button" data-sharing="facebook" class="button">Facebook</button>
                <button type="button" data-sharing="weibo" class="button">Weibo</button>
                <button type="button" data-sharing="instapaper" class="button">Instapaper</button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Share on Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a>
    
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >新浪微博开发笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-gitbook_19">
                    
                        <h1 id="">新浪微博开发笔记</h1>
<h2 id="">新浪微博</h2>
<p>作为中国移动互联网的代表性产品之一，新浪微博涵盖了大量的移动互联网元素，通过对新浪微博的研究及模仿可以：</p>
<ul>
<li><p>产品面</p>
<ul>
<li>对这些元素在实际产品中的应用有深入的了解和认识</li>
</ul>
</li>
<li><p>技术面</p>
<ul>
<li>体验Swift的优雅之处</li>
<li>能够体会在项目开发中各知识点的综合运用</li>
<li>能够对封装 &amp; 重构有更好的体会和理解</li>
<li>能够引出相关的知识点，发现自己的知识空缺</li>
<li>能够对大型项目的架构、开发及掌控有更全面的认识和理解</li>
</ul>
</li>
</ul>
<hr>
<h2 id="iphone-">iPhone 项目目标</h2>
<ul>
<li>项目掌控能力<ul>
<li>从无到有</li>
<li>如何给项目扩充新功能</li>
<li>如何维护大型项目</li>
<li>... ...</li>
</ul>
</li>
<li>工具使用能力<ul>
<li>CocoaPods</li>
<li>三方框架</li>
<li>Xcode自带工具</li>
<li>... ...</li>
</ul>
</li>
<li>开发技巧能力<ul>
<li>各种思想</li>
<li>各种技巧</li>
<li>... ...</li>
</ul>
</li>
</ul>
<hr>
<h3 id="">新浪微博接口地址</h3>
<ul>
<li><p>微博开放平台地址
<a href="http://open.weibo.com" target="_blank">http://open.weibo.com</a></p>
</li>
<li><p>微博接口文档地址
<a href="http://open.weibo.com/wiki/微博API" target="_blank">http://open.weibo.com/wiki/微博API</a></p>
</li>
</ul>
<hr>
<h2 id="">项目主体框架</h2>
<p>走向工作岗位之后，一般会遇到两种工作情况：</p>
<ol>
<li><p>新项目开发</p>
<ul>
<li>通常在项目开始之前，公司的产品经理会提供完整的产品原型图，或功能设计文档</li>
<li>通过对这些文档的解读，能够梳理出目标项目的整体架构，从而协助项目框架的搭建</li>
</ul>
</li>
<li><p>旧项目维护</p>
<ul>
<li>很多老项目是缺乏文档的，这种情况在一些小公司中表现的尤为突出</li>
<li>要想快速上手一个老项目，首先运行项目，并且整理项目整体框架结构</li>
<li>然后用整理出的框架结构与代码集合进行验证，无疑可以对了解项目的整体架构起到重要的辅助</li>
</ul>
</li>
</ol>
<p>综上所述，无论是新项目，还是老项目，在开发之前确定项目的主体架构都是非常重要，也是十分必要的！</p>
<h3 id="">主体架构确认的好处</h3>
<p>开发之前，明确项目的主体架构具有以下好处：</p>
<ol>
<li>明确开发目标，项目一旦启动，始终锁定目标前进！</li>
<li>明确功能模块的数量，方便工期核算</li>
<li>根据开发进度，预判开发周期，及时与相关部门沟通、协调</li>
<li>根据主体架构搭建项目框架，方便团队开发，各个功能模块齐头并进，提高开发效率！</li>
<li>确定项目开发中的重点难点，提前安排攻关能力强的同事进行技术攻关，待需要时能够享受攻关成果，或者及时调整产品设计</li>
<li>新增或调整功能时，能够高屋建瓴，在最合适的位置添加相关功能模块</li>
</ol>
<h3 id="">新浪微博主体架构</h3>
<p>对界面预览之后，可以发现新浪微博符合经典应用程序架构设计：</p>
<ul>
<li>主视图控制器是一个 <code>UITabbarController</code></li>
<li>包含四个 <code>UINavigationController</code>，分别是<ul>
<li>首页</li>
<li>消息</li>
<li>发现</li>
<li>我</li>
</ul>
</li>
</ul>
<p>特殊之处：</p>
<ul>
<li><code>UITabbarController</code> 中间有一个 &quot;+&quot; 按钮，点击该按钮能够 Modal 显示<code>微博类型选择</code>界面，方便用户选择自己需要的微博类型</li>
<li>四个 <code>UINavigationController</code> 在用户登录前后显示的界面格式是不一样的</li>
</ul>
<h4 id="">和原版新浪微博的区别</h4>
<p>由于必须使用新浪微博官方的 API 才能够正常开发，换言之，如果没有登录系统是无法使用新浪微博提供的接口的！</p>
<p>基于上述原因，在实际开发中对未登录之前的界面设计进行简化</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        
        <a href="./oschina.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 项目部署"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

    
    <script src="https://cdn.mathjax.org/mathjax/2.4-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-mathjax/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
